home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / xos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  3.8 KB  |  189 lines

  1. /*
  2.  * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
  3.  *
  4.  * Copyright 1987 by the Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted, provided
  8.  * that the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising
  11.  * or publicity pertaining to distribution of the software without specific,
  12.  * written prior permission. M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * The X Window System is a Trademark of MIT.
  17.  *
  18.  */
  19.  
  20. /* This is a collection of things to try and minimize system dependencies
  21.  * in a "signficant" number of source files.
  22.  */
  23.  
  24. #ifdef __HIGHC__
  25.  
  26. #ifndef NOFILE
  27. #define NOFILE   FOPEN_MAX
  28. #endif
  29.  
  30. #ifndef OPEN_MAX
  31. #define OPEN_MAX 32
  32. #endif
  33.  
  34. #endif
  35.  
  36. #ifndef _XOS_H_
  37. #define _XOS_H_
  38.  
  39. #include <X11/Xosdefs.h>
  40.  
  41. /*
  42.  * Get major data types (esp. caddr_t)
  43.  */
  44.  
  45. #ifdef USG
  46. #ifndef __TYPES__
  47. #ifdef CRAY
  48. #define word word_t
  49. #endif /* CRAY */
  50. #include <sys/types.h>                  /* forgot to protect it... */
  51. #define __TYPES__
  52. #endif /* __TYPES__ */
  53. #else /* USG */
  54. #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
  55. #undef _POSIX_SOURCE
  56. #include <sys/types.h>
  57. #define _POSIX_SOURCE
  58. #else
  59. #include <sys/types.h>
  60. #endif
  61. #endif /* USG */
  62.  
  63.  
  64. /*
  65.  * Just about everyone needs the strings routines.  We provide both forms here,
  66.  * index/rindex and strchr/strrchr, so any systems that don't provide them all
  67.  * need to have #defines here.
  68.  */
  69.  
  70. #ifndef X_NOT_STDC_ENV
  71. #include <string.h>
  72. #define index strchr
  73. #define rindex strrchr
  74. #else
  75. #ifdef SYSV
  76. #include <string.h>
  77. #define index strchr
  78. #define rindex strrchr
  79. #else
  80. #include <strings.h>
  81. #define strchr index
  82. #define strrchr rindex
  83. #endif
  84. #endif
  85.  
  86.  
  87. /*
  88.  * Get open(2) constants
  89.  */
  90. #ifdef X_NOT_POSIX
  91. #include <fcntl.h>
  92. #ifdef USL
  93. #include <unistd.h>
  94. #endif /* USL */
  95. #ifdef CRAY
  96. #include <unistd.h>
  97. #endif /* CRAY */
  98. #ifdef MOTOROLA
  99. #include <unistd.h>
  100. #endif /* MOTOROLA */
  101. #ifdef SYSV386
  102. #include <unistd.h>
  103. #endif /* SYSV386 */
  104. #include <sys/file.h>
  105. #else /* X_NOT_POSIX */
  106. #if !defined(_POSIX_SOURCE) && defined(macII)
  107. #define _POSIX_SOURCE
  108. #include <fcntl.h>
  109. #undef _POSIX_SOURCE
  110. #else
  111. #include <fcntl.h>
  112. #endif
  113.  
  114. #ifdef MSDOS
  115. #include <bsd.h>
  116. #endif
  117.  
  118.  
  119. /* eliminate conflict between stdlib.h / unistd.h for MW - DMD 06/02/93 */
  120.  
  121. #ifdef __HIGHC__
  122. #ifndef _STDLIB_H
  123. #include <unistd.h>
  124. #endif
  125. #else
  126. #include <unistd.h>
  127. #endif
  128.  
  129. #endif /* X_NOT_POSIX else */
  130.  
  131. /*
  132.  * Get struct timeval
  133.  */
  134.  
  135. #ifdef SYSV
  136.  
  137. #ifndef USL
  138. #include <sys/time.h>
  139. #endif
  140. #include <time.h>
  141. #ifdef CRAY
  142. #undef word
  143. #endif /* CRAY */
  144. #if defined(USG) && !defined(CRAY) && !defined(MOTOROLA)
  145. struct timeval {
  146.     long tv_sec;
  147.     long tv_usec;
  148. };
  149. #ifndef USL_SHARELIB
  150. struct timezone {
  151.     int tz_minuteswest;
  152.     int tz_dsttime;
  153. };
  154. #endif /* USL_SHARELIB */
  155. #endif /* USG */
  156.  
  157. #else /* not SYSV */
  158.  
  159. #if defined(_POSIX_SOURCE) && defined(SVR4)
  160. /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
  161. #undef _POSIX_SOURCE
  162. #include <sys/time.h>
  163. #define _POSIX_SOURCE
  164. #else
  165. #include <sys/time.h>
  166. #endif
  167.  
  168. #endif /* SYSV */
  169.  
  170. #ifdef MSDOS
  171. #include <time.h>
  172. #endif
  173. #ifdef __WATCOMC__
  174. #define bcopy(a,b,c)            memcpy(b,a,c)
  175. #define bcmp(a,b,c)             memcmp(a,b,c)
  176. #define bzero(a,b)              memset(a,0,b)
  177. #endif
  178.  
  179. /* use POSIX name for signal */
  180. #if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
  181. #define SIGCHLD SIGCLD
  182. #endif
  183.  
  184. #ifdef ISC
  185. #include <sys/bsdtypes.h>
  186. #endif
  187.  
  188. #endif /* _XOS_H_ */
  189.